<template>
  <div class="ne-container">
    <van-row :gutter="20">
      <van-col span="12">
        <serve-menu-card title="预约挂号" icon="gh.png" url="/pages/zhfw/hospitalsPage"/>
      </van-col>
      <van-col span="12">
        <serve-menu-card title="在线问诊" icon="wz.png" background="#80BF85" url="2##10"/>
      </van-col>
    </van-row>
    <ne-title title="医院公告"/>
    <com-notice-card :rows="noticeList" v-if="noticeList.length"/>
    <van-empty v-if="!noticeList.length" description="暂无数据"/>
    <ne-title title="医生介绍"/>
    <doctor-card
        v-for="item in dataSource"
        :key="item.indexCode"
        :row="item"
    />
    <van-empty v-if="!dataSource.length" description="暂无数据"/>
  </div>
</template>

<script>
import ComNoticeCard from "./components/ComNoticeCard.vue";
import DoctorCard from "./components/DoctorCard.vue";
import ServeMenuCard from "./components/ServeMenuCard.vue";
import LookCard from "./components/LookCard.vue";
import pagingMixin from "../../mixins/pagingMixin";
import {tbHospitalBulletinList} from "../../api/tbHospitalBulletin";
import {tbExternalLinkList} from "../../api/tbExternalLink";
export default {
  name: 'wx_pages_zhfw_communityPage',
  components: {LookCard, ComNoticeCard,DoctorCard,ServeMenuCard},
  mixins:[pagingMixin],
  data() {
    return {
      talentList:[],
      restfulApi:'/tbTalentDatabase/page',
      noticeList: [],
      url:''
    }
  },
  methods:{
    async searchNotice(){
      let res = await tbHospitalBulletinList({})
      this.noticeList = res.data
    },
    async linkSearch() {
      let res = await tbExternalLinkList({ linkType: '2', linkSubType: '10' })
      if (res.data && res.data.length > 0) {
        this.url = `/pages/share/qrcode?link=${res.data[0].linkUrl}&qrcode=${res.data[0].linkQrCode}`
      }
    },
  },
  onLoad() {
    this.searchNotice()
    this.search({talentType:'3'})
    this.linkSearch()
  }
}
</script>
<style lang="scss" scoped>

</style>
